class Message
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  #This version (3.1.3) of rails not inherit from ActiveRecord only
  #import this library because the table not exist in the database.

  attr_accessor :subject, :body

  validates_presence_of :subject, :body
  validates_length_of :subject, :maximum => DB_STRING_MAX_LENGTH
  validates_length_of :body, :maximum => DB_TEXT_MAX_LENGTH
  def initialize(params = {})
    @subject = params[:subject]
    @body = params[:body]
  end

end